export default class BaseFunctionMgr extends cc.Component {

    public static _initedErrorListener : boolean = false
    public static initErrorListener(){
        if(this._initedErrorListener) return
        this._initedErrorListener = true
        window.__errorHandler = function (filename, lineNumber, message) {
            console.error("JSERROR",filename,lineNumber,message)
            let timeStr = (new Date()).getTime()/1000;
            let kv = {
                keys:["Time","lineNumber","message"],
                values:[timeStr.toString(),lineNumber.toString(),message.toString]
            }
            let jsonStr = JSON.stringify(kv)
            cc.gg.tdUtil.doSendTdEvent("debug_error","",jsonStr)
        };
    }
}
